home *** CD-ROM | disk | FTP | other *** search
/ Openstep 4.2 (Developer) / Openstep Developer 4.2.iso / NextDeveloper / OpenStepConversion / IntermediateFrameworks1 / AppKit.framework / Headers / NSView.h < prev    next >
Encoding:
C/C++ Source or Header  |  1994-12-20  |  8.5 KB  |  280 lines

  1. /*
  2.     View.h
  3.     Application Kit, Release 2.0
  4.     Copyright (c) 1988, 1989, 1990, NeXT, Inc.  All rights reserved. 
  5. */
  6.  
  7. #import "NSWindow.h"
  8. #import "screens.h"
  9. #import <time.h>
  10.  
  11. /* Autosizing parameters */
  12.  
  13. enum {
  14.     NSViewNotSizable            =  0,
  15.     NSViewMinXMargin            =  1,
  16.     NSViewWidthSizable            =  2,
  17.     NSViewMaxXMargin            =  4,
  18.     NSViewMinYMargin            =  8,
  19.     NSViewHeightSizable            = 16,
  20.     NSViewMaxYMargin            = 32
  21. };
  22.  
  23. typedef enum _NSBorderType {
  24.     NSNoBorder                = 0,
  25.     NSLineBorder            = 1,
  26.     NSBezelBorder            = 2,
  27.     NSGrooveBorder            = 3
  28. } NSBorderType;
  29.  
  30. /* Are we drawing, printing, or copying PostScript to the scrap? */
  31.  
  32. extern short NXDrawingStatus;
  33.  
  34. /* NXDrawingStatus values */
  35.  
  36. #define NX_DRAWING    1    /* we're drawing */
  37. #define NX_PRINTING    2    /* we're printing */
  38. #define NX_COPYING    3    /* we're copying to the scrap */
  39.  
  40. extern BOOL NSScreenDump;    /* Do we draw selection while printing? */
  41.  
  42. @interface NSView : NSResponder
  43. {
  44.     NSRect              frame;
  45.     NSRect              bounds;
  46.     id                  superview;
  47.     id                  subviews;
  48.     id                  window;
  49.     struct __vFlags {
  50. #ifdef __BIG_ENDIAN__
  51.     unsigned int        noClip:1;
  52.     unsigned int        translatedDraw:1;
  53.     unsigned int        drawInSuperview:1;
  54.     unsigned int        alreadyFlipped:1;
  55.     unsigned int        needsFlipped:1;
  56.     unsigned int        rotatedFromBase:1;
  57.     unsigned int        rotatedOrScaledFromBase:1;
  58.     unsigned int        opaque:1;
  59.     unsigned int        disableAutodisplay:1;
  60.     unsigned int        needsDisplay:1;
  61.     unsigned int        validGState:1;
  62.     unsigned int        newGState:1;
  63.     unsigned int        _RESERVED:2;
  64.     unsigned int        _noVerticalAutosizing:1;
  65.     unsigned int        _hasDirtySubview:1;
  66. #else
  67.     unsigned int        _hasDirtySubview:1;
  68.     unsigned int        _noVerticalAutosizing:1;
  69.     unsigned int        _RESERVED:2;
  70.     unsigned int        newGState:1;
  71.     unsigned int        validGState:1;
  72.     unsigned int        needsDisplay:1;
  73.     unsigned int        disableAutodisplay:1;
  74.     unsigned int        opaque:1;
  75.     unsigned int        rotatedOrScaledFromBase:1;
  76.     unsigned int        rotatedFromBase:1;
  77.     unsigned int        needsFlipped:1;
  78.     unsigned int        alreadyFlipped:1;
  79.     unsigned int        drawInSuperview:1;
  80.     unsigned int        translatedDraw:1;
  81.     unsigned int        noClip:1;
  82. #endif
  83.     }                   vFlags;
  84.     struct ___vFlags {
  85. #ifdef __BIG_ENDIAN__
  86.     unsigned int        autosizing:6;
  87.     unsigned int        autoresizeSubviews:1;
  88.     unsigned int        notifyWhenFlipped:1;
  89.     unsigned int        ancestorNotifyWasEnabled:1;
  90.     unsigned int        needsAncestorNotify:1;
  91.     unsigned int        notifyToInitGState:1;
  92.     unsigned int        wantsGState:1;
  93.     unsigned int        noCopyOnScroll:1;
  94.     unsigned int        noDisplayOnScroll:1;
  95.     unsigned int        specialClip:1;
  96.     unsigned int        mark:1;
  97. #else
  98.     unsigned int        mark:1;
  99.     unsigned int        specialClip:1;
  100.     unsigned int        noDisplayOnScroll:1;
  101.     unsigned int        noCopyOnScroll:1;
  102.     unsigned int        wantsGState:1;
  103.     unsigned int        notifyToInitGState:1;
  104.     unsigned int        needsAncestorNotify:1;
  105.     unsigned int        ancestorNotifyWasEnabled:1;
  106.     unsigned int        notifyWhenFlipped:1;
  107.     unsigned int        autoresizeSubviews:1;
  108.     unsigned int        autosizing:6;
  109. #endif
  110.     }                   _vFlags;
  111.     int                 _gState;
  112.     id                  _frameMatrix;
  113.     id                  _drawMatrix;
  114.     NSString *           *_dragTypes;
  115.     void *             _vPrivate;
  116. }
  117.  
  118. - init;
  119. - initFrame:(NSRect)frameRect;
  120. - awake;
  121. - (void)dealloc;
  122. - window;
  123. - superview;
  124. - subviews;
  125. - (BOOL)isDescendantOf:aView;
  126. - findAncestorSharedWith:aView;
  127. - opaqueAncestor;
  128. - addSubview:aView;
  129. - addSubview:aView :(int)place relativeTo:otherView;
  130. - windowChanged:newWindow;
  131. - removeFromSuperview;
  132. - replaceSubview:oldView with:newView;
  133. - notifyAncestorWhenFrameChanged:(BOOL)flag;
  134. - suspendNotifyAncestorWhenFrameChanged:(BOOL)flag;
  135. - notifyWhenFlipped:(BOOL)flag;
  136. - descendantFrameChanged:sender;
  137. - descendantFlipped:sender;
  138. - resizeSubviews:(NSSize)oldSize;
  139. - superviewSizeChanged:(NSSize)oldSize;
  140. - setAutoresizeSubviews:(BOOL)flag;
  141. - setAutosizing:(unsigned int)mask;
  142. - (unsigned int)autosizing;
  143. - setFrameOrigin:(NSPoint)_newOrigin;
  144. - setFrameSize:(NSSize)_newSize;
  145. - setFrame:(NSRect)frameRect;
  146. - rotateTo:(float)angle;
  147. - moveBy:(float)deltaX :(float)deltaY;
  148. - sizeBy:(float)deltaWidth :(float)deltaHeight;
  149. - rotateBy:(float)deltaAngle;
  150. - (NSRect)frame;
  151. - (float)frameAngle;
  152. - setBoundsOrigin:(NSPoint)_newOrigin;
  153. - setBoundsSize:(NSSize)_newSize;
  154. - setDrawRotation:(float)angle;
  155. - translateOriginToPoint:(NSPoint)_translation;
  156. - scaleUnitSquareToSize:(NSSize)_newUnitSize;
  157. - rotate:(float)angle;
  158. - (NSRect)bounds;
  159. - (float)boundsAngle;
  160. - setFlipped:(BOOL)flag;
  161. - (BOOL)isFlipped;
  162. - (BOOL)isRotatedFromBase;
  163. - (BOOL)isRotatedOrScaledFromBase;
  164. - setOpaque:(BOOL)flag;
  165. - (BOOL)isOpaque;
  166. - (NSPoint)convertPointFromSuperview:(NSPoint)aPoint;
  167. - (NSPoint)convertPointToSuperview:(NSPoint)aPoint;
  168. - convertRectFromSuperview:(NSRect)aRect;
  169. - convertRectToSuperview:(NSRect)aRect;
  170. - (NSPoint)convertPoint:(NSPoint)aPoint fromView:aView;
  171. - (NSPoint)convertPoint:(NSPoint)aPoint toView:aView;
  172. - (NSSize)convertSize:(NSSize)aSize fromView:aView;
  173. - (NSSize)convertSize:(NSSize)aSize toView:aView;
  174. - convertRect:(NSRect)aRect fromView:aView;
  175. - convertRect:(NSRect)aRect toView:aView;
  176. - centerScanRect:(NSRect)aRect;
  177. - (BOOL)canDraw;
  178. - setAutodisplay:(BOOL)flag;
  179. - (BOOL)isAutodisplay;
  180. - setNeedsDisplay:(BOOL)flag;
  181. - (BOOL)needsDisplay;
  182. - update;
  183. - drawInSuperview;
  184. - (int)gState;
  185. - allocateGState;
  186. - freeGState;
  187. - notifyToInitGState:(BOOL)flag;
  188. - initGState;
  189. - renewGState;
  190. - clipToFrame:(NSRect)frameRect;
  191. - (BOOL)lockFocus;
  192. - unlockFocus;
  193. - (BOOL)isFocusView;
  194. - setClipping:(BOOL)flag;
  195. - (BOOL)doesClip;
  196. - (NSRect)visibleRect;
  197. - displayIfNeeded;
  198. - displayRect:(NSRect)rects;
  199. - display;
  200. - drawRect:(NSRect)rects;
  201. - scrollPoint:(NSPoint)aPoint;
  202. - scrollRectToVisible:(NSRect)aRect;
  203. - autoscroll:(NXEvent *)theEvent;
  204. - adjustScroll:(NSRect)newVisible;
  205. - invalidate:(NSRect)rect;
  206. - scrollRect:(NSPoint)aRect by:(NSSize)delta;
  207. - hitTest:(NSPoint)aPoint;
  208. - (BOOL)mouse:(NSPoint)aPoint inRect:(NSRect *)aRect;
  209. - findViewWithTag:(int)aTag;
  210. - (int)tag;
  211. - (BOOL)performKeyEquivalent:(NXEvent *)theEvent;
  212. - (BOOL)acceptsFirstMouse;
  213. - (BOOL)shouldDelayWindowOrderingForEvent:(NXEvent *)theEvent;
  214. - addCursorRect:(NSRect)aRect cursor:anObj;
  215. - removeCursorRect:(NSRect)aRect cursor:anObj;
  216. - discardCursorRects;
  217. - resetCursorRects;
  218. - (BOOL)shouldDrawColor;
  219. - write:(NXTypedStream *)stream;
  220. - read:(NXTypedStream *)stream;
  221.  
  222. @end
  223.  
  224. @interface NSView(Printing)
  225.  
  226. - copyPSCodeInside:(NSRect)rect to:(NXStream *)stream;
  227. - writePSCodeInside:(NSRect)copyArea to:pasteboard;
  228. - printPSCode:sender;
  229. - faxPSCode:sender;
  230. - faxPSCode:sender toList:(const char *const *)names numberList:(const char *const *)numbers sendAt:(time_t)when wantsCover: (BOOL)cFlag wantsNotify: (BOOL)nFlag wantsHires: (BOOL)hFl faxName: (NSString *)aString;
  231. - (BOOL)knowsPagesFirst:(int *)firstPageNum last:(int *)lastPageNum;
  232. - openSpoolFile:(char *)filename;
  233. - beginPSOutput;
  234. - beginPrologueBBox:(NSRect)boundingBox creationDate:(NSString *)dateCreated createdBy:(NSString *)anApplication fonts:(NSString *)fontNames forWhom:(NSString *)user pages:(int)numPages title:(NSString *)aTitle;
  235. - endHeaderComments;
  236. - endPrologue;
  237. - beginSetup;
  238. - endSetup;
  239. - beginPage:(int)ordinalNum label:(NSString *)aString bBox:(NSRect)pageRect fonts:(NSString *)fontNames;
  240. - beginPageSetupRect:(NSRect)aRect placement:(NSPoint)location;
  241. - addToPageSetup;
  242. - endPageSetup;
  243. - endPage;
  244. - beginTrailer;
  245. - endTrailer;
  246. - endPSOutput;
  247. - spoolFile:(NSString *)filename;
  248. - (float)heightAdjustLimit;
  249. - (float)widthAdjustLimit;
  250. - adjustPageWidthNew:(float *)newRight left:(float)oldLeft right:(float)oldRight limit:(float)rightLimit;
  251. - adjustPageHeightNew:(float *)newBottom top:(float)oldTop bottom:(float)oldBottom limit:(float)bottomLimit;
  252. - (NSRect)rectForPage;
  253. - placePrintRect:(NSRect)aRect offset:(NSPoint)location;
  254. - drawSheetBorderWithSize:(NSSize)_borderSize;
  255. - drawPageBorderWithSize:(NSSize)_borderSize;
  256.  
  257. @end
  258.  
  259.  
  260. @interface NSView(Drag)
  261. - dragImage:anImage at:(NSPoint)viewLocation offset:(NSSize)initialOffset event:(NXEvent *)event pasteboard:(NSPasteboard *)pboard source:sourceObj slideBack:(BOOL)slideFlag;
  262.  
  263. - registerForDraggedTypes:(NSArray *)newTypes;
  264. - unregisterDraggedTypes;
  265. @end
  266.  
  267.  
  268. @interface NSView (IconDragging)
  269. - dragFile:(NSString *)filename fromRect:(NSRect)rect slideBack:(BOOL)aFlag event:(NXEvent *)event;
  270. @end
  271.  
  272. @interface NSView (RIBPrinting)
  273. - (BOOL)canPrintRIB;
  274. @end
  275.  
  276. @interface NSObject(NXPrintingUserInterface)
  277. - (BOOL)shouldRunPrintPanel:aView;
  278. @end
  279.  
  280.